<%@ page contentType="application/octet-stream;charset=UTF-8"%><%@ page
	import="java.io.*"%><%@ page import="com.gzgi.framework.util.*"%><%@ page
	import="com.gzgi.framework.context.*"%><%@ page
	import="com.gzgi.framework.resource.model.*"%><%@ page
	import="com.gzgi.framework.resource.service.*"%><%@ page
	import="org.apache.commons.fileupload.*"%>
<%
      try {  
		    String fileId = request.getParameter("fileId");
			if(fileId != null){
                DataFileService dataFileService = (DataFileService)ContextFactory.getBean("dataFileService"); 
				DataFile dataFile = dataFileService.getDataFile(fileId);
				if(dataFile != null && dataFile.getInputStream() != null){
					ResponseUtil.download(request, response, dataFile.getInputStream(), dataFile.getFilename());
					dataFile.getInputStream().close();
					dataFile = null;
				}
			}
         } catch (Exception ex) {   
            ex.printStackTrace();   
            response.getWriter().print("{'success':flase,'message':'失败'}");   
         }   
%>